package com.qkl.xiatang.app.utils.appenum;


import com.qkl.xiatang.app.utils.AppUtils;
import lombok.Getter;

import java.util.HashMap;
import java.util.Map;

/**
 * 饲料类型
 */
@Getter
public enum FeedTypeEnum {

    SHRIMP(1,"饲料"),
    HEALTH(2,"动保"),
    ;


    private FeedTypeEnum(Integer type,String name){
        this.type = type;
        this.name = name;
        FeedTypeMap.typeMap.put(type,this);
    }

    public static FeedTypeEnum getTypeEnum(String type){
        return getTypeEnum(AppUtils.parseInt(type));
    }

    public static FeedTypeEnum getTypeEnum(Integer type){
        return FeedTypeMap.typeMap.get(type);
    }

    private Integer type;

    private String name;

    private static  class FeedTypeMap{
        public static Map<Integer,FeedTypeEnum> typeMap = new HashMap<>();
    }

}
